<template>
	<view class="wrapper vCenter">
		<view style="width: 80%;">
			<view style="text-align: center;margin-bottom: 20px; font-size: 20px; font-weight: 600;">登录页面</view>
			<view><input class="input_first" v-model="username" placeholder="输入账号" /></view>
			<view><input class="input_first"  v-model="password" placeholder="输入密码" type="password" /></view>
			<view><button @click="goPage()" style="margin-top: 20px;background-color: #3390f5; color: #FFFFFF;" >登录</button></view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				username: 'admin',
				password: '123456'
			}
		},
		methods: {
			goPage() {
				console.log("e:点击login");
				if(this.username != 'admin' || this.password !='123456'){
					let title='账号或密码错误';
					uni.showToast({
						title,
						icon: 'error'
					})
					return;
				}
				uni.switchTab({
					url: '/pages/tabBar/component/component',
					
					fail(err){
						console.error("err:",err)
					}
				})
			}
		}
	}
</script>

<style>
	.wrapper{
		width: 100%;
		height: 100%;
		border: 1px solid #ddd;
		box-sizing: border-box;
	}
	.vCenter{
		display: flex;
		align-items: center;
		justify-content: center;
	}
	.input_first{
		height: 45px;
		line-height: 45px;
		border: 1px solid #ddd;
		padding: 0 10px;
		border-radius: 3px;
		margin-bottom: 10px;
	}
</style>
